package lhdx8;

public class Dog extends Pet {

    public Dog(String name, String variety, int weight, int e) {
        super(name, variety, weight,e);
    }
    public void print(){
        super.print();
    }
    public void jie(){
        System.out.println(getName()+"还可以接飞盘！");
        System.out.println(getName()+"还可以抓老鼠！");
    }

    @Override
    public String toString() {
        return  "这是一只叫" +getName() + "的宠物！";
    }

    @Override
    public boolean equals(Object obj) {
        Dog b=(Dog)obj;
        return this.getName().equals(b.getName());
    }

}
